<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html lang="zh-cn">
    <head>
        <title>迷你酥 - 用户注册</title>
    	<%@ include file="../site/jspf/head-tag.jspf" %>
        <link rel="stylesheet" href="<%=request.getContextPath()%>/static/talent/css/widget.css">
        <link rel="stylesheet" href="<%=request.getContextPath()%>/static/talent/css/login.css">
    </head>
    <body>
    	<div class="login_logo">
        	<a href="<%=request.getContextPath()%>/SiteServlet"><img src="<%=request.getContextPath()%>/static/talent/image/i_login_log.png" alt="回到首页"></a>
    	</div>
	    <div class="l_r_container">
			<!-- 快捷登录 -->
			<section id="register-box" class="ordinary_landing_box register_box">
		    <a href="" class="dialog_close"></a>
		    <div class="ol_title clearfix">
		        <div class="ol_title_l f_left">
		            <span class="active">注册</span>
		        </div>
		        <div class="ol_title_r f_right">
		            <a href="<%=request.getContextPath()%>/TalentServlet?act=toLoginPage" class="jump">登录</a>
		        </div>
		    </div>
		
		    <!-- 注册表单 -->
		    <div class="ol_body">
		        <form onsubmit="return validateForm();" action="<%=request.getContextPath()%>/TalentServlet?act=register" method="post">
		            <p class="sys_err none"></p>
		            <ul>
		            	<!-- 用户昵称 -->
		                <li class="nick_name clearfix">
		                    <div>
		                        <label for="nickname"></label>
		                        <input type="text" id="nickname" onblur="checkNickname()" name="nickname" placeholder="昵称" class="nick_n v n_b" maxlength="20" autocomplete="off">
		                        <p id="nicknameInfo" class="err none">请输入昵称</p>
		                        <span class="f_right p">20个字符（10个汉字）以内</span>
		                    </div>
		                </li>
		                <!-- 登录帐号 -->
		                <li class="clearfix">
		                    <div class="user_name_box">
		                        <label for="code"></label>
		                        <input name="code" onblur="checkCode()" type="text" placeholder="请输入帐号" class="n_b v" id="code" >
		                        <p id="codeInfo" class="err none">请输入帐号</p>
		                    </div>
		                </li>
		                <!-- 密码 -->
		                <li class="passw clearfix">
		                    <div>
		                        <label for="password"></label>
		                        <input type="password" onblur="checkPassword()" name="password" placeholder="输入6-14位密码，必须含数字和字母" class="pw n_b v" id="password">
		                        <p id="passwordInfo" class="err none">请输入密码</p>
		                    </div>
		                </li>
		                <!-- 验证码 -->
		                <li class="vcode clearfix">
		                    <div>
		                        <label for="r-captcha"></label>
		                        <input type="text" name="captcha" placeholder="验证码" class="v" autocomplete="off">
		                        <c:if test="${not empty errorInfo}">
		                        	<p class="err">${errorInfo}</p>
		                        </c:if>
		                        <span class="f_right">
		                            <a href="javascript:;">
		                                <img src="<%=request.getContextPath()%>/verify-code.jsp" title="看不清？" onclick="this.src='<%=request.getContextPath()%>/verify-code.jsp?r='+new Date();">
		                            </a>
		                        </span>
		                    </div>
		                </li>
		            </ul>
		            
		            <p class="mb15">
		                <input type="submit" value="创建账号" class="auth_btn">
		            </p>
					<aside class="sign">
						<p class="other_method">
							<input type="checkbox" id="agree" checked="checked" value="1" data-necessary="true">
							<label for="agree"><i></i>同意并遵守</label><a href="/term.html" target="_blank" ka="user-agreement">《用户协议》</a>
						</p>
					</aside>
		        </form>
		    </div>
		    <script>
               var nickname = document.getElementById("nickname");
              	function checkNickname() {
              		if(!nickname.value) {
              			document.getElementById("nicknameInfo").className = "err";
              			return false;
              		}
              		return true;
              	}
              	var code = document.getElementById("code");
              	function checkCode() {
              		if(!code.value) {
              			document.getElementById("codeInfo").className = "err";
              			return false;
              		}
              		return true;
              	}
              	var password = document.getElementById("password");
              	function checkPassword() {
              		if(!password.value) {
              			document.getElementById("passwordInfo").className = "err";
              			return false;
              		}
              		return true;
              	}
				function validateForm() {
              		return checkNickname() && checkCode() && checkPassword();
              	}
              </script>
		</section>
	<!-- 密码登录 -->
	</div>
	<footer>
		<p><em>137026</em>家公司内部员工在这里点评</p>
	</footer>
    </body>
</html>